package com.wecan.oauth.DTO.security;

import com.wecan.base.DTO.base.KeyDTO;
import com.wecan.base.enums.EnableStatus;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

/**
 * @Author liuzhihao
 * @Date 2022.01.20
 * @Version ${version}
 * @Description ${description}
 */
@Schema(title = "更新角色")
@Data
public class UpdateRoleDTO extends KeyDTO {
    @Schema(title = "角色名称")
    @NotBlank(message = "角色名称不能为空")
    @Size(min = 1, max = 30, message = "角色名称长度受限")
    private String name;

    @Schema(title = "角色权限列表")
    @Pattern(regexp = "^\\[(\\w+,)*\\w+\\]$", message = "角色权限列表格式错误")
    private String permissionIds;

    @Schema(title = "角色描述")
    @Size(max = 255, message = "角色描述内容过多")
    private String remark;

    @Schema(title = "角色状态")
    private EnableStatus status;
}
